This can be a painful and slow experience so I wanted to share some tips about this topic :)
First of all, using tools that automatically convert your filesystem is dangerous and not reliable, you can lose your data! So the best option is always to just transfer the data, this also ensures their consistency and health of your data located in your disks
The only tool that I recommend for that is using rsync, this is the only tool that provides everything needed, secured, fast, integrity, correct copy of file types, reliable, and you can even stop a copy and continue another day
Let's say that I want to move from reiserfs to btrfs, as:
But now I'm in a difficult situation:
So I can't use both disks in the same computer, I'm forced to use 2 different computers. And this is not a problem at all using rsync :)
To replicate the data from dir1 to dir2 you should use this rsync call:
sudo rsync -avn --delete /home/thana/dir1/ /home/thana/dir2/
Notes:
This is the best and optimal way to transfer files from a directory to another, ensuring consistency, management of links, etc.. in other words, to replicate data from a place to another
But what if the data is from another computer (called zeus)? you just need to call in one of these possible ways:
sudo rsync -avn --delete zeus:/home/thana/dir1/ /home/thana/dir2/ sudo rsync -avn --delete root@zeus:/home/thana/dir1/ /home/thana/dir2/ sudo rsync -avn --delete zeus.local:/home/thana/dir1/ /home/thana/dir2/ sudo rsync -avn --delete root@ipaddress:/home/thana/dir1/ /home/thana/dir2/
Any of them are valid, note that the "zeus.local" one requires that feature provided in the Elive installer, which basically allows you to ping / access to any remote computer in your network by using its name.local value
If the disks includes only this data you can run "df" to compare the same sizes, otherwise use "du -hs" to the directories
If you want to make sure-sure that the data has been transfered correctly, run again the same rsync command, if you add the option "c" it will checksum every data to make sure that their contents are the same (this is as slow as a full new transfer)
Now, I wanted to switch to btrfs with transparent compression, I need to do all of this from computer B since is the one that supports it correctly, you can do it from gparted
Unplug / plug the disk. Open your filemanager and mount your new partition
Now run the command "mount" to ensure that all the mount options are the wanted ones (since you did not defined them!), and there's is a problem: our mounted btrfs is not mounted with compression, in fact, you cannot set this parameter when formatting the partition (so bad!), and to use compression you need to always mount the filesystem with this option included (auto if is set in your fstab), but you can remount the partition to add this option:
mount -o remount -o compress=zstd /mnt/something/
Another option is to run this command to recompress the data:
sudo btrfs defragment -r -v -zstd /mnt/something/
Now you are ready to copy back the data to your new mounted disk, and start using it when finishes :)
Note: by not being able to "always mount by default" the partition with compression, all the new data will be not compressed, you should remount it before to use the disk or to run the defrag command later (much slower)